package com.geekstudy.week9;


import com.geekstudy.api.OrderApi;
import com.geekstudy.api.UserApi;
import com.geekstudy.entity.Order;
import com.geekstudy.entity.User;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

@Service
public class DubboClientService {

    @DubboReference(version = "1.0.0")
    private UserApi userApi;

    @DubboReference(version = "1.0.0")
    private OrderApi orderApi;

    public User queryUser(int id) {
       User user = userApi.findById(id);
       return user;
    }

    public Order queryOrder(int id) {
        Order order = orderApi.findOrderById(id);
        return order;
    }
}
